/**
 * Copyright &copy; 2012-2015  All rights reserved.
 */
package com.smartwork.modules.sys.entity;

import com.smartwork.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

/**
 * 客户端版本管理Entity
 * @author Albertyan
 * @version 2015-12-25
 */
public class ClientVersion extends DataEntity<ClientVersion> {
	
	private static final long serialVersionUID = 1L;
	private String projectName;		// *应用名称
	private String versionNo;		// *版本号
	private Long buildNo;		// *内部版本
	private String path;		// *应用路径
	private String clientOs;		// *应用类型
	private String publishState;		// *发布状态
	private Long lowBuildNo;		// *最低要求内部版本
	private String versionInfo;		// 版本更新信息
	private String iconPath;		// 应用图标
	private Long dwCount;		// 下载量
	private Long fileSize;		// 应用大小
	
	public ClientVersion() {
		super();
	}

	public ClientVersion(String id){
		super(id);
	}

	@Length(min=1, max=100, message="*应用名称长度必须介于 1 和 100 之间")
	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}
	
	@Length(min=1, max=10, message="*版本号长度必须介于 1 和 10 之间")
	public String getVersionNo() {
		return versionNo;
	}

	public void setVersionNo(String versionNo) {
		this.versionNo = versionNo;
	}
	
	public Long getBuildNo() {
		return buildNo;
	}

	public void setBuildNo(Long buildNo) {
		this.buildNo = buildNo;
	}
	
	@Length(min=1, max=200, message="*应用路径长度必须介于 1 和 200 之间")
	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}
	
	@Length(min=1, max=20, message="*应用类型长度必须介于 1 和 20 之间")
	public String getClientOs() {
		return clientOs;
	}

	public void setClientOs(String clientOs) {
		this.clientOs = clientOs;
	}
	
	@Length(min=1, max=1, message="*发布状态长度必须介于 1 和 1 之间")
	public String getPublishState() {
		return publishState;
	}

	public void setPublishState(String publishState) {
		this.publishState = publishState;
	}
	
	@NotNull(message="*最低要求内部版本不能为空")
	public Long getLowBuildNo() {
		return lowBuildNo;
	}

	public void setLowBuildNo(Long lowBuildNo) {
		this.lowBuildNo = lowBuildNo;
	}
	
	@Length(min=0, max=200, message="版本更新信息长度必须介于 0 和 200 之间")
	public String getVersionInfo() {
		return versionInfo;
	}

	public void setVersionInfo(String versionInfo) {
		this.versionInfo = versionInfo;
	}
	
	@Length(min=1, max=200, message="应用图标长度必须介于 1 和 200 之间")
	public String getIconPath() {
		return iconPath;
	}

	public void setIconPath(String iconPath) {
		this.iconPath = iconPath;
	}
	
	public Long getDwCount() {
		return dwCount;
	}

	public void setDwCount(Long dwCount) {
		this.dwCount = dwCount;
	}
	
	@NotNull(message="应用大小不能为空")
	public Long getFileSize() {
		return fileSize;
	}

	public void setFileSize(Long fileSize) {
		this.fileSize = fileSize;
	}
	
	@Override
	public String getSeqName() {
		return "sys_client_version.id";
	}
}